/**
 * Copyright (C) 2018-2020
 * All rights reserved, Designed By www.gzchengguo.cn

 */
package link.chengguo.orangemall.modules.activity.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import link.chengguo.orangemall.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
* @author chengguo
* @date 2020-05-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("Orange_store_coupon_issue")
public class OrangeStoreCouponIssue extends BaseDomain {

    private static final long serialVersionUID = 1L;

    @TableId
    private Integer id;


    private String cname;


    /** 优惠券ID */
    private Integer cid;

    private Integer ctype;


    /** 优惠券领取开启时间 */
    @NotNull(message = "请选择结束时间")
    private Date startTime;


    /** 优惠券领取结束时间 */
    @NotNull(message = "请选择开始时间")
    private Date endTime;


    /** 优惠券领取数量 */
    private Integer totalCount;


    /** 优惠券剩余领取数量 */
    private Integer remainCount;


    /** 是否无限张数 */
    private Integer isPermanent;


    /** 1 正常 0 未开启 -1 已无效 */
    private Integer status;



    public void copy(OrangeStoreCouponIssue source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
